/**
 * File:   NetworkListener.java
 * Author: Gvennet
 */
package dht.network;

import dht.identifier.identifier.Identifier;
import dht.node.DHTDataRow;
import dht.node.DHTNodeContacts;

import java.io.IOException;
import java.net.InetAddress;
import java.util.List;
//import gui.DHTDataTableModel;

/**
 * todo write javadoc
 */
public interface NetworkListener
{

	void receivePingRequest(InetAddress fromAddress, int fromPort, Identifier id, int messageId) throws IOException;

	void receivePingResponse(InetAddress fromAddress, int fromPort, Identifier id) throws IOException;

	void receiveGetNodesRequest(InetAddress address, int port, Identifier id, int messageId, Identifier searchingIdentifier)
			throws IOException;

	void receiveGetNodesResponse(InetAddress address, int port, Identifier id, List<DHTNodeContacts> list)
			throws IOException;

	void receivePutValueRequest(InetAddress address, int port, Identifier id, int messageId, Identifier valueId, String value)
			throws IOException;

	void receivePutValueResponse(InetAddress address, int port, Identifier id) throws IOException;

	void receiveGetValueRequest(InetAddress address, int port, Identifier id, int messageId, Identifier valueId)
			throws IOException;

	void receiveGetValueResponse(InetAddress address, int port, Identifier id, List<DHTDataRow> values)
			throws IOException;

	void receiveGetValueResponseNodes(InetAddress address, int port, Identifier id, Identifier valueId, DHTNodeContacts node)
			throws IOException;

	void receiveTimeout(DHTNodeContacts node);

	//void setGuiListener(DHTDataTableModel getTableModel);
}
